<!--[formGroup]表示响应式表单-->
<!--[formGroup]绑定对象，formGroupName绑定字符串-->
<form [formGroup]="formModel" (submit)="onSubmit()">
  <div>
    <input type="text" formControlName="username">
  </div>
  <!--formModel 下 formGroupName 绑定group name-->
  <div formGroupName="rangDate">
    <!--绑定formModel 下 formGroupName rangDate 绑定formControl from to -->
    <input type="date" formControlName="from">
    <input type="date" formControlName="to">
  </div>
  <div>
    <ul formArrayName="emails">
      <!--获取emials的属性-->
      <li *ngFor="let e of this.formModel.get('emails').controls;let i=index">
        <input type="email" [formControlName]="i">
      </li>
    </ul>
    <input type="button" (click)="addEamil()" value="增加邮件">
  </div>
  <div>
    <button type="submit">提交</button>
  </div>
</form>
